home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple Reference & Presen…rary 6 (Reseller Edition)
/
Apple Ref. & Pres. Lib.v6.0.toast
/
pc
/
3-Presentations
/
Apple Demos
/
Training
/
HyperCard 2.0 Training
/
•HC 2.0-2
/
card_6240.txt
< prev
next >
Wrap
Text File
|
1990-08-07
|
6KB
|
316 lines
-- card: 6240 from stack: in.0-2
-- bmap block id: 6558
-- flags: 0000
-- background id: 10385
-- name: student.2
----- HyperTalk script -----
on closeCard
if icon of btn "switch" is 282 then click at loc of btn "switch"
end closeCard
on calculate
get char 1 of card field "EMF"
if it="+" then
delete char 1 of card field "EMF"
end if
put card field "EMF" into E
get char 1 of card field "R1"
if it="+" then
delete char 1 of card field "R1"
end if
put card field "R1" into R1
put abs(R1) into R1
put R1 into card field "R1"
get char 1 of card field "R2"
if it="+" then
delete char 1 of card field "R2"
end if
put card field "R2" into R2
put abs(R2) into R2
put R2 into card field "R2"
if E=0 then
send zeroall
exit calculate
end if
if R1=0 and R2=0 then
put "zap" into card field "A1"
put 0 into card field "V1"
put 0 into card field "V2"
put 0 into card field "V3"
exit calculate
end if
put E/(R1+R2) into I
put I*R1 into V1
put I*R2 into V2
set numberFormat to "0.000"
put I into card field "A1"
put V1 into card field "V1"
put V2 into card field "V2"
put E*1 into card field "V3"
end calculate
--on closeField
--set icon of btn "switch" to "open circuit"
--send zeroall
--end closeField
on zeroall
put 0 into card field "A1"
put 0 into card field "V1"
put 0 into card field "V2"
put 0 into card field "V3"
end zeroall
-- part 2 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=336 top=137 right=171 bottom=375
-- title width / last selected line: 0
-- icon id / first selected line: 28757 / 28757
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: switch
----- HyperTalk script -----
on mouseUp
if icon of me is 28757 then
set icon of me to "close circuit"
calculate
else
set icon of me to "open circuit"
zeroall
end if
end mouseUp
-- part 3 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=163 top=109 right=122 bottom=226
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: EMF
----- HyperTalk script -----
on closeField
if icon of cd btn "Switch" is not 28757 then calculate
end closeField
-- part 4 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=123 top=140 right=152 bottom=159
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 8
-- style flags: 0
-- line height: 10
-- part name: A1
----- HyperTalk script -----
on mouseUp
if 3 = 4 then
end if
end mouseUp
-- part 5 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=228 top=164 right=176 bottom=266
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 8
-- style flags: 0
-- line height: 10
-- part name: V3
-- part 6 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=186 top=203 right=216 bottom=221
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: R1
----- HyperTalk script -----
on closeField
if icon of cd btn "Switch" is not 28757 then calculate
end closeField
-- part 7 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=276 top=203 right=216 bottom=311
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: R2
----- HyperTalk script -----
on closeField
if icon of cd btn "Switch" is not 28757 then calculate
end closeField
-- part 8 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=183 top=262 right=274 bottom=221
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 8
-- style flags: 0
-- line height: 10
-- part name: V1
----- HyperTalk script -----
on mouseUp
if 3 = 4 then
end if
end mouseUp
-- part 9 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=272 top=262 right=274 bottom=310
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 8
-- style flags: 0
-- line height: 10
-- part name: V2
----- HyperTalk script -----
on mouseUp
if 3 = 4 then
end if
end mouseUp
-- part 11 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=225 top=283 right=297 bottom=243
-- title width / last selected line: 0
-- icon id / first selected line: 15420 / 15420
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
lock screen
go prev
unlock screen with wipe right
end mouseUp
-- part 12 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=257 top=283 right=297 bottom=275
-- title width / last selected line: 0
-- icon id / first selected line: 16560 / 16560
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
lock screen
go next
unlock screen with wipe left
end mouseUp
-- part 14 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=242 top=82 right=103 bottom=369
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 174
-- text size: 14
-- style flags: 2304
-- line height: 18
-- part name:
-- part contents for card part 3
----- text -----
10
-- part contents for card part 4
----- text -----
0
-- part contents for card part 8
----- text -----
0
-- part contents for card part 9
----- text -----
0
-- part contents for card part 5
----- text -----
0
-- part contents for card part 6
----- text -----
10
-- part contents for card part 7
----- text -----
10
-- part contents for card part 14
----- text -----
SERIES